﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WaterRevenueMS.Domain.Common.Models;
using System.ComponentModel.DataAnnotations;

namespace WaterRevenueMS.Domain.ViewModels.BasicSet.Manufacturer
{
    public class ManufacturerModel : EntityCommon
    {
        public ManufacturerModel()
        {
            Search = new SearchModel();
        }

        public int Id { get; set; }
        [Display(Name="水表厂商")]
        [Required(ErrorMessage="水表厂商不能为空")]
        [StringLength(16,MinimumLength=2,ErrorMessage="水表厂商{2}-{1}个字符")]
        public string Shui_BCS { get; set; }

        [Display(Name = "排序序号")]
        public int OrderNo { get; set; }

        [Display(Name="厂商名称")]
        [StringLength(64,MinimumLength=0,ErrorMessage="厂商名称{2}-{1}个字符")]
        public string Chang_SMC { get; set; }

        [Display(Name = "厂商地址")]
        [StringLength(128, MinimumLength = 0, ErrorMessage = "厂商地址{2}-{1}个字符")]
        public string Chang_SDZ { get; set; }

        [Display(Name = "厂商简介")]
        [StringLength(2048, MinimumLength = 0, ErrorMessage = "厂商简介{2}-{1}个字符")]
        public string Chang_SJJ { get; set; }

        [RegularExpression(@"\d+", ErrorMessage = "必须是数字")]
        [Display(Name = "电话")]
        [StringLength(128, MinimumLength = 0, ErrorMessage = "电话{2}-{1}个字符")]
        public string Dian_H { get; set; }

        [RegularExpression(@"\d+", ErrorMessage = "必须是数字")]
        [Display(Name = "传真")]
        [StringLength(64, ErrorMessage = "传真不能少于{1}个字符")]
        public string Chuan_Z { get; set; }

        [Display(Name = "联系人")]
        [StringLength(64, ErrorMessage = "传真不能少于{1}个字节")]
        public string Lian_XR { get; set; }

        [Display(Name = "是否激活")]
        public bool Enabled { get; set; }
        public SearchModel Search { get; set; }
    }
    public class SearchModel
    {
        public SearchModel()
        {

        }

        [Display(Name = "厂商名称")]
        public string Chang_SMC { get; set; }

        [Display(Name = "厂商地址")]
        public string Chang_SDZ { get; set; }

        [Display(Name = "厂商简介")]
        public string Chang_SJJ { get; set; }

        [Display(Name = "联系人")]
        public string Lian_XR { get; set; }
    }
}
